<script>
	/**
	 * Copyright (c) 2013-Now http://you-magic.vip All rights reserved.
	 */
	export default {
		onLaunch() {
			// 国际化，设置当前语言
			// if (this.vuex_locale) {
			// 	this.$i18n.locale = this.vuex_locale;
			// 	this.$u.api.lang({
			// 		lang: this.vuex_locale
			// 	});
			// }

			// console.log(this.vuex_token, 999999999);
			if (!this.vuex_token) {
				let that = this
				uni.login({
					provider: 'weixin',
					success: function(loginRes) {
						
						that.$u.vuex("vuex_code", loginRes.code);
						that.$u.api
						.auth({
							code: loginRes.code,
							scene: '',
							from_uid: ''
						})
						.then((res) => {
							that.$u.vuex("vuex_token", res.token);
							
							
						});
					}
				});

			}


		}
	}
</script>

<style lang="scss">
	@import "uview-ui/index.scss";
</style>
